import { RouteRecordRaw } from 'vue-router';

const routes:Array<RouteRecordRaw> = [
  // 应用基础模板的路由
  {
    path: '/user',
    name: 'User',
    component: () => import('@/layouts/BaseLayout/index.vue'),
    children: [
      {
        path: '/user/login',
        name: 'Login',
        component: () => import('@/pages/Users/Login/index.vue')
      },
      {
        path: '/user/forgetPassword',
        name: 'ForgetPassword',
        component: () => import('@/pages/Users/ForgetPassword/index.vue')
      },
    ]
  },
  // 应用主要模板的路由
  {
    path: '/',
    component: () => import('@/layouts/MainLayout/index.vue'),
    redirect: {
      name: 'Login'
    },
    children: [
      {
        path: '/dashborad',
        name: 'Dashboard',
        component: () => import('@/pages/Dashborad/index.vue'),
        meta: {
          title: '员工分析',
          icon: 'dashborad',
          auth: true,
        }
      },
      
      
      {
        path: '/attendance',
        name: 'Attendance',
        component: () => import('@/pages/Attendance/index.vue'),
        meta: {
          title: '出勤统计',
          icon: 'attendance',
          auth: false,
        }
      },
      {
        path: '/staff',
        name: 'Staff',
        component: () => import('@/pages/Staff/index.vue'),
        meta: {
          title: '员工管理',
          icon: 'team',
          auth: false,
        }
      },
      {
        path: '/department',
        name: 'Department',
        component: () => import('@/pages/Department/index.vue'),
        meta: {
          title: '部门管理',
          icon: 'department',
          auth: true,
        }
      },
      {
        path: '/level',
        name: 'Level',
        component: () => import('@/pages/Level/index.vue'),
        meta: {
          title: '职级管理',
          icon: 'level',
          auth: false,
        }
      },
      {
        path: '/assessment',
        name: 'Assessment',
        component: () => import('@/pages/Assessment/index.vue'),
        meta: {
          title: '绩效考核',
          icon: 'assessment',
          auth: false,
        }
      },
      {
        path: '/salaryAdjustment',
        name: 'SalaryAdjustment',
        component: () => import('@/pages/SalaryAdjustment/index.vue'),
        meta: {
          title: '调薪记录',
          icon: 'salary',
          auth: false,
        }
      },
      {
        path: '/rewardPunishRecord',
        name: 'RewardPunishRecord',
        component: () => import('@/pages/RewardPunishRecord/index.vue'),
        meta: {
          title: '奖惩记录',
          icon: 'rewardPunishRecord',
          auth: false,
        }
      },
      {
        path: '/attendanceInfo',
        name: 'AttendanceInfo',
        component: () => import('@/pages/AttendanceInfo/index.vue'),
        meta: {
          title: '考勤信息',
          icon: 'bar-chart',
          auth: false,
        }
      },
      {
        path: '/404',
        name: '404Page',
        component: () => import('@/pages/404Page/index.vue'),
        meta: {
          title: '404页面',
          icon: 'dashborad',
          auth: false,
        }
      },
      
    ]
  },
  {
    path: '/:pathMatch(.*)',
    redirect: {
      name: '404Page'
    }
  }
];

export default routes;